//
//  ProductImageCell.m
//  KiklinkApp
//
//  Created by LJC on 14-9-29.
//  Copyright (c) 2014年 Kiklink. All rights reserved.
//

#import "ProductImageCell.h"

#import "UIColor+hex.h"

#import "UIImageView+WebCache.h"

@implementation ProductImageCell

- (void)awakeFromNib
{
    self.contentView.backgroundColor = [UIColor colorWithHexString:AppColor_BackGround];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.titleLabel.adjustsFontSizeToFitWidth = YES;
    self.subTitleLabel.adjustsFontSizeToFitWidth = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)loadDataWithProduct:(Product *)product
{
    self.titleLabel.text = product.name;
    self.subTitleLabel.text = product.ext5;
    self.priceLabel.text = [NSString stringWithFormat:@"%ld",(long)product.price];
    
    self.image.clipsToBounds = YES;
    [self.image sd_setImageWithURL:[NSURL URLWithString:[Base_Url stringByAppendingString:product.photo]] placeholderImage:[UIImage imageNamed:@"placeHolder.png"]];
}

@end
